package vip.ola.manage.sys.ctrl;

import com.alibaba.fastjson.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import vip.ola.core.common.annotation.MethodLog;
import vip.ola.core.common.constant.RetEnum;
import vip.ola.core.common.domain.BizResponse;
import vip.ola.core.common.domain.PayResponse;
import vip.ola.manage.common.ctrl.BaseController;
import vip.ola.manage.common.service.RpcCommonService;
import vip.ola.manage.secruity.JwtUser;

import java.time.LocalDateTime;
import java.util.List;

import static vip.ola.core.common.constant.Constant.MGR_CONTROLLER_ROOT_PATH;

/**
 * 代理商安全中心
 */
@Controller
@RequestMapping(MGR_CONTROLLER_ROOT_PATH + "/clean")
public class CleanController extends BaseController {

    @Autowired
    private RpcCommonService rpcCommonService;

    /**
     * 清理数据
     *
     * @return
     */
    @RequestMapping("/clean")
    @MethodLog(remark = "清理数据")
    @ResponseBody
    public ResponseEntity<?> getGoogleAuthQrCode(String itemJson, LocalDateTime startTime, LocalDateTime endTime) {
//        JwtUser user = getUser();
//        if (user.getIsSuperAdmin().equals('0')) {
//            return ResponseEntity.ok(BizResponse.build(RetEnum.RET_COMM_RECORD_NOT_AUTH));
//        }
//        JSONArray jsonArray = JSONArray.parseArray(itemJson);
//        boolean isOk = rpcCommonService.rpcSysService.cleanData(jsonArray.toJavaList(String.class), startTime, endTime);
        return ResponseEntity.ok(PayResponse.buildSuccess(true));
    }


}